<style>
    #${serviceNameSimple}DetailDiv .list-group-item {
        padding: 4px 15px;
    }

    #${serviceNameSimple}DetailDiv .row > div {
        margin-top: 5px;
    }
</style>

<script>

    $(function () {

        var ${serviceNameSimple}Id = '${r'${'}${serviceNameSimple}.idx}';

        function ${serviceNameSimple}ItemTableInit(type) {
            $('#${serviceNameSimple}DetailDiv #${serviceNameSimple}ItemTable').bootstrapTable({
                url: '${r'${rc.contextPath}'}/${serviceNameSimple}/item/list',
                queryParams: function (params) {
                    params['${serviceNameSimple}Id'] = ${r'${'}${serviceNameSimple}.idx${r'}'};
                    return params;
                },
                columns: [],
                sortName: "create_time",
                sortOrder: "desc"
            });
        }

        ${serviceNameSimple}ItemTableInit();

        $("#${serviceNameSimple}DetailDiv #${serviceNameSimple}ItemButton").click(function () {
            openWindows("添加信息", "${r'${rc.contextPath}'}/${table.controllerPath}/item/edit", {${serviceNameSimple}Id: ${serviceNameSimple}Id}, function (index, layero) {
                ${serviceNameSimple}ItemSubmitForm(index)
            });
        });

    });

    function ${serviceNameSimple}ItemEdit(idx, ${serviceNameSimple}Id) {
        openWindows("修改信息", "${r'${rc.contextPath}'}/${table.controllerPath}/item/edit", {idx: idx, ${serviceNameSimple}Id: ${serviceNameSimple}Id}, function (index, layero) {
            ${serviceNameSimple}ItemSubmitForm(index)
        });
    }

    function ${serviceNameSimple}ItemDelete(idx, filename) {
        $.confirm({
            icon: 'fa fa-warning',
            content: '确认删除序号【' + filename + '】？',
            confirm: function () {
                commonAjaxJson("${r'${rc.contextPath}'}/${table.controllerPath}/item/delete", {
                    idx: idx
                }, function (data) {
                    if (data.code === 0) {
                        layer.msg("删除成功");
                        ${serviceNameSimple}ItemRefresh();
                    } else {
                        layer.msg(data.message);
                    }
                });
            },
            cancel: function () {
            }
        });
    }

    function ${serviceNameSimple}ItemRefresh() {
        $("#${serviceNameSimple}DetailDiv #${serviceNameSimple}ItemTable").bootstrapTable("refresh");
    }

</script>

<div id="${serviceNameSimple}DetailDiv">
    <div class="animated wrapper fadeInRight" style="width: 100%; height: 100%;">
        <div class="ibox-content">

            <div class="overflow-auto font17" style="padding:15px 30px 15px 15px;">
                <div class="row">
                    <div class="col-md-4"><span style="line-height:10px;">${table.comment}：${r'${'}${serviceNameSimple}.xxx}</span></div>
                </div>
            </div>

            <div class="row nomargin-lr">
                <div class="col-md-8">

                    <div class="row">
                        <#list table.fields as field>
                        <#if field.propertyName == "idx">
                        <#else>
                        <div class="col-xs-2 text-right">${field.comment}：</div>
                        <div class="col-xs-4 no-padding">${r'${'}(${serviceNameSimple}.${(field.propertyName)?replace("Id", "Name")})!'&nbsp;'}</div>
                        </#if>
                        </#list>
                    </div>

                </div>
                <div class="col-md-4">
                    <button type="button" class="btn btn-warning font14 form-control-static margin-b-s" id="${serviceNameSimple}ItemButton">&nbsp;操作1&nbsp;</button>
                </div>
            </div>

            <br/>
            <table class="table table-bordered table-hover" id="${serviceNameSimple}ItemTable"></table>

        </div>
    </div>

</div>
